package com.resume.controller;

import com.resume.domain.XueLi;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Date;
import java.util.List;

/**
 * @Author: 梁云亮
 * @Date: 2021/7/15 16:54
 * @Describe:
 */
@Controller
public class DispatcherController {

    @RequestMapping("/{index}")
    public String index(@PathVariable("index") String index) {
        return index;
    }

    @PostMapping("/swagger1")
    @ApiOperation(value = "修改部门地址", notes = "根据部门编号修改部门地址")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "deptno", value = "部门ID", required = true, dataType = "Integer"),
            @ApiImplicitParam(paramType = "query", name = "dname", value = "部门名称", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "loc", value = "部门地址", required = true, dataType = "String")
    })
    public List<Date> swagger1(@RequestParam(value = "deptno") Integer deptno,
                               @RequestParam(value = "dname") String dname,
                               @RequestParam(value = "loc") String loc) {
        return null;
    }

    @ApiIgnore //使用该注解忽略这个API
    @GetMapping(value = "/swagger2")
    public String  swagger2() {
        return " hi you!";
    }
}
